home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: in2.uu.net!world!mv!usenet
- From: ENGR@GSSI.MV.COM (Michael Furman)
- Subject: Re: void main() and other atrocities!
- Message-ID: <DM45HK.4zG@mv.mv.com>
- Mime-Version: 1.0
- Organization: GSSI
- Date: Thu, 1 Feb 1996 20:12:56 GMT
- References: <4eduaj$1aq@grouper.Exis.Net> <4eeeso$b5l@fountain.mindlink.net> <4em17r$shq@jaxnet.jaxnet.com> <4emub9$1mo@fountain.mindlink.net> <4epplj$egf@host-3.cyberhighway.net>
- X-Newsreader: WinVN 0.93.10
- X-Nntp-Posting-Host: gssi.mv.com
-
- In article <4epplj$egf@host-3.cyberhighway.net>, mjellis@cyberhighway.net
- says...
- >
- >In <4emub9$1mo@fountain.mindlink.net>, genew@mindlink.bc.ca (Gene Wirchenko)
- wri
- >tes:
- >> So do many people who post that you can use void main() and other
- >>atrocities.
- >
- >>Sincerely,
- >>
- >>Gene Wirchenko
- >
- >Hey...ease up buddy. I'm one of those idiots that made such a post 'void
- main()
- >' and a nice gentlemen sent me an email informing me of the ANSI standard
- regard
- >ing this.
- >
- >Because of this nice gentlemen's information, now I know better. And, he
- didn't
- > scare me off this newsgroup be blowing my head off with a cannon! Email
- works
- >wonders and it's *so* much more courteous.
-
- And by the way, number of C/C++ implementations allow "void main(.." as a
- language extension. Don't get me wrong - I strongly don't recommend using
- this extention, like any unportable staff without some reason - and I
- can't realize what reason is to use/allow this extention.
-
- Heare is quote from MS Visual C/C++ help:
- >>>>> begin >>>>>
- A special function called main is the entry point to all C++ programs. This
- function is not predefined by the compiler; rather, it must be supplied in
- the program text. If you are writing code that adheres to the Unicode
- programming model, you can use the wide-character version of main, wmain. The
- declaration syntax for main is:
- int main( );
-
- or, optionally:
- int main( int argc[ , char *argv[ ] [, char *envp[ ] ] ] );
-
- The declaration syntax for wmain is as follows:
- int wmain( );
-
- or, optionally:
- int wmain( int argc[ , wchar_t *argv[ ] [, wchar_t *envp[ ] ] ] );
-
- Alternatively, the main and wmain functions can be declared as returning void
- (no return value). If you declare main or wmain as returning void, you cannot
- return an exit code to the parent process or operating system using a return
- statement; to return an exit code when main or wmain are declared as void,
- you must use the exit function.
- >>>>>> end >>>>>>
-
-
- >
- >John Ellis
- >mjellis@cyberhighway.net
- >john@ici.usa.net
- >Idaho Central Interchange BBS: (208) 677-2028
- >
-
- --
- <<<<<<<< This is a copy of post to the newsgroup >>>>>>>>
- ---------------------------------------------------------------
- Michael Furman, (603)893-1109
- Geophysical Survey Systems, Inc. fax:(603)889-3984
- 13 Klein Drive - P.O. Box 97 engr@gssi.mv.com
- North Salem, NH 03073-0097 71543.1334@compuserve.com
- ---------------------------------------------------------------
-
-